﻿using System;
using System.Collections.Generic; 
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class dlthqzs : System.Web.UI.Page
{
    protected List<Model.LotteryAnnouncement> arlist = null; 
    protected int jinqiCount = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            jinqiCount = 30;
            bindData(30);
        }
    }

    protected int[] TiaoxingDT2 = new int[11];
    protected void bindData(int maxValue)
    {

        int Count = 0;
        arlist = BLL.LotteryAnnouncement.GetPageList_Where(0, maxValue, 2, out  Count);

        if (arlist != null)
        { 

            for (int i = 0; i < arlist.Count; i++)
            {
                //重号
                string[] SSQblue = arlist[i].LotteryNo.Split('+')[1].Split(','); ; //蓝球  
                //计算条形图中每个数的个数  
                bindTiaoxing(SSQblue);   
            }
             
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        jinqiCount = int.Parse(DropDownList1.SelectedValue);
        bindData(int.Parse(DropDownList1.SelectedValue));
    }
    protected int[] TiaoxingDT = new int[34];
    /// <summary>
    /// 计算条形码数值
    /// </summary>
    /// <param name="type">0蓝球号码走势，1蓝球尾数</param>
    /// <param name="data">数字</param>
    protected void bindTiaoxing(string[] SSQblue)
    {
        if (SSQblue.Length == 2)
        { 
            for (int i = 0; i < 12; i++)
            {
                if (int.Parse(SSQblue[0]) == (i + 1))
                    {
                        TiaoxingDT[i] += 1;
                    }
                if (int.Parse(SSQblue[1]) == (i + 1))
                {
                    TiaoxingDT[i] += 1;
                }  
            }
            for (int i = 12; i < 23; i++)
            {
                if (int.Parse(SSQblue[0]) == (i -11))
                    {
                        TiaoxingDT[i] += 1;
                    }
            } 
            for (int i = 23; i < 34; i++)
            {
                if (int.Parse(SSQblue[1]) == (i - 21))
                {
                    TiaoxingDT[i] += 1;
                }
            }
        }
    }
}